package model

import "time"

type UrlMap struct {
	ID             int64     `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
	ShortURL       string    `gorm:"column:short_url" json:"short_url"`
	LongURL        string    `gorm:"column:long_url" json:"long_url"`
	ShortURLDigest string    `gorm:"column:short_url_digest" json:"short_url_digest"`
	LongURLDigest  string    `gorm:"column:long_url_digest" json:"long_url_digest"`
	CompressCode   string    `gorm:"column:compress_code" json:"compress_code"`
	Description    string    `gorm:"column:description" json:"description,omitempty"`
	Source         string    `gorm:"column:source" json:"source"`
	URLStatus      int16     `gorm:"column:url_status" json:"url_status"`
	CreateTime     time.Time `gorm:"column:create_time;autoCreateTime" json:"create_time"`
	EditTime       time.Time `gorm:"column:edit_time;autoUpdateTime" json:"edit_time"`
	Creator        string    `gorm:"column:creator" json:"creator"`
	Editor         string    `gorm:"column:editor" json:"editor"`
	Deleted        int16     `gorm:"column:deleted" json:"deleted"`
	Version        int64     `gorm:"column:version" json:"version"`
}

func (UrlMap) TableName() string {
	return "url_map"
}
